Multi-state Flash EEprom system on a card that includes defective cell substitution

ABSTRACT

A system of Flash EEprom memory chips with controlling circuits serves as non-volatile memory such as that provided by magnetic disk drives. Improvements include selective multiple sector erase, in which any combinations of Flash sectors may be erased together. Selective sectors among the selected combination may also be de-selected during the erase operation. Another improvement is the ability to remap and replace defective cells with substitute cells. The remapping is performed automatically as soon as a defective cell is detected. When the number of defects in a Flash sector becomes large, the whole sector is remapped. Yet another improvement is the use of a write cache to reduce the number of writes to the Flash EEprom memory, thereby minimizing the stress to the device from undergoing too many write/erase cycling.

CROSS-REFERENCE TO RELATED APPLICATIONS

This is a continuation of patent application Ser. No. 08/407,916, filedMar. 21, 1995, now U.S. Pat. No. 5,719,808, which in turn is acontinuation of patent application Ser. No. 07/963,851, filed Oct. 20,1992, now U.S. Pat. No. 5,418,752, which in turn is a division of patentapplication Ser. No. 07/337,566, filed Apr. 13, 1989, now abandoned.

BACKGROUND OF THE INVENTION

This invention relates generally to semiconductor electrically erasableprogrammable read only memories (EEprom), and specifically to a systemof integrated circuit Flash EEprom chips.

Computer systems typically use magnetic disk drives for mass storage ofdata. However, disk drives are disadvantageous in that they are bulkyand in their requirement for high precision moving mechanical parts.Consequently they are not rugged and are prone to reliability problems,as well as consuming significant amounts of power. Solid state memorydevices such as DRAM's and SRAM's do not suffer from thesedisadvantages. However, they are much more expensive, and requireconstant power to maintain their memory (volatile) Consequently, theyare typically used as temporary storage.

EEprom's and Flash EEprom's are also solid state memory devices.Moreover, they are non-volatile, and retain their memory even afterpower is shut down. However, conventional Flash EEprom's have a limitedlifetime in terms of the number of write (or program)/erase cycles theycan endure. Typically the devices are rendered- unreliable after 10² to10³ write/erase cycles. Traditionally, they are typically used inapplications where semi-permanent storage of data or program is requiredbut with a limited need for reprogramming.

Accordingly, it is an object of the present invention to provide a FlashEEprom memory system with enhanced performance and which remainsreliable after enduring a large number of write/erase cycles.

It is another object of the present invention to provide an improvedFlash EEprom system which can serve as non-volatile memory in a computersystem.

It is another object of the present invention to provide an improvedFlash EEprom system that can replace magnetic disk storage devices -incomputer systems.

It is another object of the present invention to provide a Flash EEpromsystem with improved erase operation.

It is another object of the present invention to provide a Flash EEpromsystem with improved error correction.

It is yet another object of the present invention to provide a FlashEEprom with improved write operation that minimizes stress to the FlashEEprom device.

It is still another object of the present invention to provide a FlashEEprom system with enhanced write operation.

SUMMARY OF THE INVENTION

These and additional objects are accomplished by improvements in thearchitecture of a system of EEprom chips, and the circuits andtechniques therein.

According to one aspect of the present invention, an array of FlashEEprom cells on a chip is organized into sectors such that all cellswithin each sector are erasable at once. A Flash EEprom memory systemcomprises one or more Flash EEprom chips under the control of acontroller. The invention allows any combination of sectors among thechips to be selected and then erased simultaneously. This is faster andmore efficient than prior art schemes where all the sectors must beerased every time or only one sector at a time can be erased. Theinvention further allows any combination of sectors selected for eraseto be deselected and prevented from further erasing during the eraseoperation. This feature is important for stopping those sectors that arefirst to be erased correctly to the "erased" state from over erasing,thereby preventing unnecessary stress to the Flash EEprom device. Theinvention also allows a global de-select of all sectors in the system sothat no sectors are selected for erase. This global reset can quicklyput the system back to its initial state ready for selecting the nextcombination of sectors for erase. Another feature of the invention isthat the selection is independent of the chip select signal whichenables a particular chip for read or write operation. Therefore it ispossible to perform an erase operation on some of the Flash EEprom chipsand write operations may be performed on other chips not involved in theerase operation.

According to another aspect of the invention, improved error correctioncircuits and techniques are used to correct for errors arising fromdefective Flash EEprom memory cells. One feature of the invention allowsdefect mapping at cell level in which a defective cell is replaced by asubstitute cell from the same sector. The defect pointer which connectsthe address of the defective cell to that of the substitute cell isstored in a defect map. Every time the defective cell is accessed, itsbad data is replaced by the good data from the substitute cell.

Another feature of the invention allows defect mapping at the sectorlevel. When the number of defective cells in a sector exceeds apredetermined number, the sector containing the defective cells isreplaced by a substitute sector.

An important feature of the invention allows defective cells ordefective sectors to be remapped as soon as they are detected therebyenabling error correction codes to adequately rectify the relatively fewerrors that may crop up in the system.

According to yet another aspect of the present invention, a write cacheis used to minimize the number of writes to the Flash EEprom memory. Inthis way the Flash EEprom memory will be subject to fewer stressinducing write/erase cycles, thereby retarding its aging. The mostactive data files are written to the cache memory instead of the FlashEEprom memory. Only when the activity levels have reduced to apredetermined level are the data files written from the cache memory tothe Flash EEprom memory. Another advantage of the invention is theincrease in write throughput by virtue of the faster cache memory.

According to yet another aspect of the present invention, one or moreprinted circuit cards are provided which contain controller and EEpromcircuit chips for use in a computer system memory for long term,non-volatile storage, in place of a hard disk system, and whichincorporate various of the other aspects of this invention alone and incombination.

Additional objects, features, and advantages of the present inventionwill be understood from the following description of its preferredembodiments, which description should be taken in conjunction with theaccompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a general micrprocessor system including the Flash EEprommemory system of the present invention;

FIG. 1B is schematic block diagram illustrating a system including anumber of Flash EEprom memory chips and a controller chip;

FIG. 2 is a schematic illustration of a system of Flash EEprom chips,among which memory sectors are selected to be erased;

FIG. 3A is a block diagram circuit on a Flask EEprom chip forimplementing selective multiple sector erase according to the preferredembodiment;

FIG. 3B shows details of a typical register used to select a sector forerase as shown in FIG. 2A;

FIGS. 4(1)-4(11) is a flow diagram illustrating the erase sequence ofselective multiple sector erase;

FIG. 5 is a schematic illustration showing the partitioning of a FlashEEprom sector into-a data area and a spare redundant area;

FIG. 6 is a circuit block diagram illustrating the data path controlduring read operation using the defect mapping scheme of the preferredembodiment;

FIG. 7 is a circuit block diagram illustrating the data path controlduring the write operation using the defect mapping scheme of thepreferred embodiment;

FIG. 8 is a block diagram illustrating the write cache circuit insidethe controller.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

EEprom System

A computer system in which the various aspects of the present inventionare incorporated is illustrated generally in FIG. 1A. A typical computersystem architecture includes a microprocessor 21 connected to a systembus 23, along with random access, main system memory 25, and at leastone or more input-output devices 27, such as a keyboard, monitor, modem,and the like. Another main-computer system component that is connectedto a typical computer system bus 23 is a large amount of long-term,non-volatile memory 29. Typically, such a memory is a disk drive with acapacity of tens of megabytes of data storage. This data is retrievedinto the system volatile memory 25 for use in current processing, andcan be easily supplemented, changed or altered.

One aspect of the present invention is the substitution of a specifictype of semiconductor memory systems for the disk drive but withouthaving to sacrifice non-volatility, ease of erasing and rewriting datainto the memory, speed of access, low cost and reliability. This isaccomplished by employing an array of electrically erasable programmableread only memories (EEprom's) integrated circuit chips. This type ofmemory has additional advantages of requiring less power to operate, andof being lighter in weight than a hard disk drive magnetic media memory,thereby being especially suited for battery operated portable computers.

The bulk storage memory 29 is constructed of a memory controller 31,connected to the computer system bus 23, and an array 33 of EEpromintegrated circuit chips. Data and instructions are communicated fromthe controller 31 to the EEprom array 33 primarily over a serial dataline 35. Similarly, data and status signals are communicated from theEEprom 33 to the controller 31 over serial data lines 37. Other controland status circuits between the controller 31 and the EEprom array 33are not shown in FIG. 1A.

Referring to FIG. 1B, the controller 31 is preferably formed primarilyon a single integrated circuit chip. It is connected to the systemaddress and data bus 39, part of the system bus 33, as well as beingconnected to system control lines 41, which include interrupt, read,write and other usual computer system control lines.

The EEprom array 33 includes a number of EEprom integrated circuit chips43, 45, 47, etc. Each includes a respective chip select and enable line49, 51 and 53 from interface circuits 40. The interface circuits 40 alsoact to interface between the serial data lines 35, 37 and a circuit 55.Memory location addresses and data being written into or read from theEEprom chips 43, 45, 47, etc. are communicated from a bus 55, throughlogic and register circuits 57 and by another bus 59 to each of thememory chips 43, 45, 47 etc.

The bulk storage memory 29 of FIGS. 1A and 1B can be implemented on asingle printed circuit card for moderate memory sizes. The various linesof the system buses 39 and 41 of FIG. 1B are terminated in connectingpins of such a card for connection with the rest of the computer systemthrough a connector. Also connected to the card and its components arevarious standard power supply voltages (not shown).

For large amounts of memory, that which is conveniently provided by asingle array 33 may not be enough. In such a case, additional EEpromarrays can be connected to the serial data lines 35 and 37 of thecontroller chip 31, as indicated in FIG. 1B. This is preferably all doneon a single printed circuit card but if space is not sufficient to dothis, then one or more EEprom arrays may be implemented on a secondprinted circuit card that is physically mounted onto the first andconnected to a common controller chip 31.

Erase of Memory Structures

In system designs that store data in files or blocks the data will needto be periodically updated with revised or new information. It may alsobe desirable to overwrite some no longer needed information, in order toaccommodate additional information. In a Flash EEprom memory, the memorycells must first be erased before information is placed in 7 them. Thatis, a write (or program) operation is always preceded by an eraseoperation.

In conventional Flash erase memory devices, the erase operation is donein one of several ways. For example, in some devices such as the Intelcorporation's model-27F-256 CMOS Flash EEprom, the entire chip is erasedat one time. If not all the information in the chip is to be erased, theinformation must first be temporarily saved, and is usually written intoanother memory (typically RAM). The information is then restored intothe nonvolatile Flash erase memory by programming back into the device.This is very slow and requires extra memory as holding space.

In other devices such as Seeq Technology Incorporated's model 48512Flash EEprom chip, the memory is divided into blocks (or sectors) thatare each separately erasable, but only one at a time. By selecting thedesired sector and going through the erase sequence the designated areais erased. While, the need for temporary memory is reduced, erase invarious areas of the memory still requires a time consuming sequentialapproach.

In the present invention, the Flash EEprom memory is divided intosectors where all cells within each sector are erasable together. Eachsector can be addressed separately and selected for erase. One importantfeature is the ability to select any combination of sectors for erasetogether. This will allow for a much faster system erase than by doingeach one independently as in prior art.

FIG. 2 illustrates schematically selected multiple sectors for erase. AFlash EEprom system includes one or more Flash EEprom chips such as 201,203, 205. They are in communication with a controller 31 through lines209. Typically, the controller 31 is itself in communication with amicroprocessor system (not shown). The memory in each Flash EEprom chipis partitioned into sectors where all memory cells within a sector areerasable together. For example, each sector may have 512 byte (i.e.512×8 cells) available to the user, and a chip may have 1024 sectors.Each sector is individually addressable, and may be selected, such assectors 211, 213, 215, 217 in a multiple sector erase. As illustrated inFIG. 2, the selected sectors may be confined to one EEprom chip or bedistributed among several chips in a system. The sectors that wereselected will all be erased together. This capability will allow thememory and system of the present invention to operate much faster thanthe prior art architectures.

FIG. 3A illustrates a block diagram circuit 220 on a Flash EEprom chip(such as the chip 201 of FIG. 2) with which one or more sectors such as211, 213 are selected (or deselected) for erase. Essentially, eachsector such as 211, 213 is selected or tagged by setting the state of anerase enable register such as 221, 223 associated with the respectivesectors. The selection and subsequent erase operations are performedunder the control of the controller 31 (see FIG. 2). The circuit 220 isin communication with the controller 31 through lines 209. Commandinformation from the controller is captured in the circuit 220 by acommand register 225 through a serial interface 227. It is then decodedby a command decoder 229 which outputs various control signals.Similarly, address information is captured by an address register 231and is decoded by an address decoder 233.

For example, in order to select the sector 211 for erase, the controllersends the address of the sector 211 to the circuit 220. The address isdecoded in line 235 and is used in combination with a set erase enablesignal in bus 237 to set an output 239 of the register 221 to HIGH. Thisenables the sector 211 in a subsequent erase operation. Similarly, ifthe sector 213 is also desired to be erased, its associated register 223may be set HIGH.

FIG. 3B shows the structure of the register such as 221, 223 in moredetail. The erase enable register 221 is a SET/RESET latch. Its setinput 241 is obtained from the set erase enable signal in bus 237 gatedby the address decode in line 235. Similarly, the reset input 243 isobtained from the clear erase enable signal in bus 237 gated by theaddress decode in line 235. In this way, when the set erase enablesignal or the clear erase enable signal is issued to all the sectors,the signal is effective only on the sector that is being addressed.

After all sectors intended for erase have been selected, the controllerthen issues to the circuit 220, as well as all other chips in the systema global erase command in line 251 along with the high voltage forerasing in line 209. The device will then erase all the sectors thathave been selected (i.e. the sectors 211 and 213) at one time. Inaddition to erasing the desired sectors within a chip, the architectureof the present system permits selection of sectors across various chipsfor simultaneous erase.

FIGS. 4(1)-4(11) illustrate the algorithm used in conjunction with thecircuit 220 of FIG. 3A. In FIG. 4(1), the controller will shift theaddress into the circuit 220 which is decoded in the line to the eraseenable register associated with the sector that is to be erased. In FIG.4(2), the controller shifts in a command that is decoded to a set eraseenable command which is used to latch the address decode signal onto theerase enable register for the addressed sector. This tags the sector forsubsequent erase. In FIG. 4(3), if more sectors are to be tagged, theoperations described relative to FIGS. 4(1)-4(2) are repeated until allsectors intended for erase have been tagged. After all sectors intendedfor erase have been tagged, the controller initiates an erase cycle asillustrated in FIG. 4(4).

Optimized erase implementations have been disclosed in two copendingU.S. patent applications. They are copending U.S. patent applications,Ser. No. 204,175, filed Jun. 8, 1988, by Dr. Eliyahou Harari, now U.S.Pat. No. 5,095,344, and one entitled "Multi-State EEprom Read and WriteCircuits and Techniques," Ser. No. 07/337,579, filed Apr. 13, 1989, nowabandoned, by Sanjay Mehrotra and Dr. Eliyahou Harari. The disclosuresof the two applications are hereby incorporate by reference. The FlashEEprom cells are erased by applying a pulse of erasing voltage followedby a read to verify if the cells are erased to the "erased" state. Ifnot, further pulsing and verifying are repeated until the cells areverified to be erased. By erasing in this controlled manner, the cellsare not subject to over-erasure which tends to age the EEprom deviceprematurely as well as make the cells harder to program.

As the group of selected sectors is going through the erase cycle, somesectors will reach the "erase" state earlier than others. Anotherimportant feature of the present invention is the ability to removethose sectors that have been verified to be erased from the group ofselected sectors thereby preventing them from over-erasing.

Returning to FIG. 4(4), after all sectors intended for erase have beentagged, the controller initiates an erase cycle to erase the group oftagged sectors. In FIG. 4(5), the controller shifts in a global commandcalled Enable Erase into each Flash EEprom chip that is to perform anerase. This is followed in FIG. 4(5) by the controller raising of theerase voltage line (Ve) to a specified value for a specified duration.The controller will lower this voltage at the end of the erase durationtime. In FIG. 4(6), the controller will then do a read verify sequenceon the sectors selected for erase. In FIG. 4(7), if none of the sectorsare verified, the sequences illustrated in FIGS. 4(5)-4(7) are repeated.In FIGS. 4(8) and 3(9), if one or more sectors are verified to beerased, they are taken out of the sequence. Referring also to FIG. 3A,this is achieved by having the controller address each of the verifiedsectors and clear the associated erase enable registers back to a LOWwith a clear enable command in bus 237. The sequences illustrated inFIGS. 4(5)-4(10) are repeated until all the sectors in the group areverified to be erased in FIG. 4(11). At the completion of the erasecycle, the controller will shift in a No Operation (NOP) command and theglobal Enable Erase command will be withdrawn as a protection against afalse erasure.

The ability to select which sectors to erase and which ones not to, aswell as which ones to stop erasing is advantageous. It will allowsectors that have erased before the slower erased sectors to be removedfrom the erase sequence so no further stress on the device will occur.This will increase the reliability of the system. Additional advantageis that if a sector is bad or is not used for some reason, that sectorcan be skipped over with no erase occurring within that sector. Forexample, if a sector is defective and have shorts in it, it may consumemuch power. A significant system advantage is gained by the presentinvention which allows it to be skipped on erase cycles so that it maygreatly reduce the power required to erase the chip.

Another consideration in having the ability to pick the sectors to beerased within a device is the power savings to the system. Theflexibility in erase configuration of the present invention enables theadaptation of the erase needs to the power capability of the system.This can be done by configuring the systems to be erased differently bysoftware on a fixed basis between different systems. It also will allowthe controller to adaptively change the amount of erasing being done bymonitoring the voltage level in a system, such as a laptop computer.

An additional performance capability of the system in the presentinvention is the ability to issue a reset command to a Flash EEprom chipwhich will clear all erase enable latches and will prevent any furthererase cycles from occurring. This is illustrated in FIGS. 2A and 2B bythe reset signal in the line 261. By doing this in a global way to allthe chips, less time will be taken to reset all the erase enableregisters.

An additional performance capability is to have the ability to do eraseoperations without regard to chip select. Once an erase is started insome of the memory chips, the controller in the system can access othermemory chips and do read and write operations on them. In addition, thedevice(s) doing the erase can be selected and have an address loaded forthe next command following the erase.

Defect Mapping

Physical defects in memory devices give rise to hard errors. Databecomes corrupted whenever it is stored in the defective cells. Inconventional memory devices such as RAM's and Disks, any physicaldefects arising from the manufacturing process are corrected at thefactory. In RAM's, spare redundant memory cells on chip may be patchedon, in place of the defective cells. In the traditional disk drive, themedium is imperfect and susceptible to defects. To overcome this problemmanufacturers have devised various methods of operating with thesedefects present, the most usual being defect mapping of sectors. In anormal disk system the media is divided into cylinders and sectors. Thesector being the basic unit in which data is stored. When a system ispartitioned into the various sectors the sectors containing the defectsare identified and are marked as bad and not to be used by the system.This is done in several ways. A defect map table is stored on aparticular portion of the disk to be used by the interfacing controller.In addition, the bad sectors are marked as bad by special ID and flagmarkers. When the defect is addressed, the data that would normally bestored there is placed in an alternative location. The requirement foralternative sectors makes the system assign spare sectors at somespecific interval or location. This reduces the amount of memorycapacity and is a performance issue in how the alternative sectors arelocated.

One important application of the present invention is to replace aconventional disk storage device with a system incorporating an array ofFlash EEprom memory chips. The EEprom system is preferably set up toemulate a conventional disk, and may be regarded as a "solid-statedisk".

In a "disk" system made from such solid-state memory devices, low costconsiderations necessitate efficient handling of defects. Anotherimportant feature of the invention enables the error correction schemeto conserve as much memory as possible. Essentially, it calls for thedefective cells to be remapped cell by cell rather than by throwing awaythe whole sector (512 bytes typically) whenever a defect occurs in it.This scheme is especially suited to the Flash EEprom medium since themajority of errors will be bit errors rather than a long stream ofadjacent defects as is typical in traditional disk medium.

In both cases of the prior art RAM and magnetic disk, once the device isshipped from the factory, there is little or no provision for replacinghard errors resulting from physical defects that appear later duringnormal operation. Error corrections then mainly rely on schemes usingerror correction codes (ECC).

The nature of the Flash EEprom device predicates a higher rate of cellfailure especially with increasing program/erase cycling. The harderrors that accumulate with use would eventually overwhelm the ECC andrender the device unusable. One important feature of the presentinvention is the ability for the system to correct for hard errorswhenever they occur. Defective cells are detected by their failure toprogram or erase correctly. Also during read operation, defective cellsare detected and located by the ECC. As soon as a defective cell isidentified, the controller will apply defect mapping to replace thedefective cell with a space cell located usually within the same sector.This dynamic correction of hard errors, in addition to conventionalerror correction schemes, significantly prolongs the life of the device.

Another feature of the present invention is an adaptive approach toerror correction. Error correction code (ECC) is employed at all timesto correct for soft errors as well as any hard errors that may arise. Assoon as a hard error is detected, defect mapping is used to replace thedefective cell with a spare cell in the same sector block. Only when thenumber of defective cells in a sector exceeds the defect mapping'scapacity for that specific sector will the whole sector be replaced asin a conventional disk system. This scheme minimized wastage withoutcompromising reliability.

FIG. 5 illustrates the memory architecture for the cell remappingscheme. As described before, the Flash EEprom memory is organized intosectors where the cells in each sector are erasable together. The memoryarchitecture has a typical sector 401 organized into a data portion 403and a spare (or shadow) portion 405. The data portion 403 is memoryspace available to the user. The spare portion 405 is further organizedinto an alternative defects data area 407, a defect map area 409, aheader area 411 and an ECC and others area 413. These areas containinformation that could be used by the controller to handle the defectsand other overhead information such as headers and ECC.

Whenever a defective cell is detected in the sector, a good cell in thealternative defects data area 407 is assigned to backup the datadesignated for the defective cell. Thus even if the defective cellstores the data incorrectly, an error-free copy is stored in the backupcell. The addresses of the defective cell and the backup cell are storedas defect pointers in the defect map 409.

It is to be understood that the partitioning between the user dataportion 403 and the spare portion 405 need not be rigid. The relativesize of the various partitioned areas may be logically reassigned. Alsothe grouping of the various areas is largely for the purpose ofdiscussion and not necessarily physically so. For example, thealternative defects data area 407 has been schematically grouped underthe spare portion 405 to express the point that the space it occupies isno longer available to the user.

In a read operation, the controller first reads the header, the defectmap and the alternative defects data. It then reads the actual data. Itkeeps track of defective cells and the location of the substitute databy means of the defect map. Whenever a defective cell is encountered,the controller substitutes its bad data with the good data from thealternative defects.

FIG. 6 illustrates the read data path control in the preferredembodiment. A memory device 33 which may include a plurality of FlashEEprom chips is under the control of the controller 31. The controller31 is itself part of a microcomputer system under the control of amicroprocessor (not shown). To initiate the reading of a sector, themicroprocessor loads a memory address generator 503 in the controllerwith a memory address for starting the read operation. This informationis loaded through a microprocessor interface port 505. Then themicroprocessor loads a DMA controller 507 with the starting location inbuffer memory or bus address that the data read should be sent. Then themicroprocessor loads the header information (Head, Cylinder and sector)into a holding register file 509. Finally, the microprocessor loads acommand sequencer 511 with a read command before passing control to thecontroller 31.

After assuming control, the controller 31 first addresses the header ofthe sector and verifies that the memory is accessed at the address thatthe user had specified. This is achieved by the following sequence. Thecontroller selects a memory chip (chip select) among the memory device33 and shifts the address for the header area from the address generator503 out to the selected memory chip in the memory device 33. Thecontroller then switches the multiplexer 513 and shifts also the readcommand out to the memory device 33. Then the memory device reads theaddress sent it and begins sending serial data from the addressed sectorback to the controller. A receiver 515 in the controller receives thisdata and puts it in parallel format. In one embodiment, once a byte (8bits) is compiled, the controller compares the received data against theheader data previously stored by the microprocessor in the holdingregister file 509. If the compare is correct, the proper location isverified and the sequence continues.

Next the controller 31 reads the defect pointers and loads these badaddress locations into the holding register file 509. This is followedby the controller reading the alternative defects data that were writtento replace the bad bits as they were written. The alternative bits arestored in an alternative defects data file 517 that will be accessed asthe data bits are read.

Once the Header has been determined to be a match and the defectpointers and alternative bits have been loaded, the controller begins toshift out the address of the lowest address of the desired sector to beread. The data from the sector in the memory device 33 is then shiftedinto the controller chip 31. The receiver 515 converts the data to aparallel format and transfers each byte into a temporary holding FIFO519 to be shipped out of the controller.

A pipeline architecture is employed to provide efficient throughput asthe data is gated through the controller from the receiver 515 to theFIFO 519. As each data bit is received from memory the controller iscomparing the address of the data being sent (stored in the addressgenerator 507) against the defect pointer map (stored in the registerfile 509). If the address is determined to be a bad location, by a matchat the output of the comparator 521, the bad bit from the memoryreceived by the receiver 515 is replaced by the good bit for thatlocation. The good bit is obtained from the alternative defects datafile 517. This is done by switching the multiplexer 523 to receive thegood bit from the alternative defects data file instead of the bad bitfrom the receiver 515, as the data is sent to the FIFO 519. Once thecorrected data is in the FIFO it is ready to be sent to buffer memory orsystem memory (not shown). The data is sent from the controller's FIFO519 to the system memory by the controller's DMA controller 507. Thiscontroller 507 then requests and gets access to the system bus and putsout an address and gates the data via an output interface 525 out to thesystem bus. This is done as each byte gets loaded into the FIFO 519. Asthe corrected data is loaded into the FIFO it will also be gated into anECC hardware 527 where the data file will be acted on by the ECC.

Thus in the manner described, the data read from the memory device 33 isgated through the controller 31 to be sent to the system. This processcontinues until the last bit of addressed data has been transferred.

In spite of defect mapping of previously detected defective cells, newhard errors might occur since the last mapping. As the dynamic defectmapping constantly "puts away" new defective cells, the latest harderror that may arise between defect mapping would be adequately handledby the ECC. As the data is gated through the controller 31, thecontroller is gating the ECC bits into the ECC hardware 527 to determineif the stored value matched the just calculated remainder value. If itmatches then the data transferred out to the system memory was good andthe read operation was completed. However, if the ECC registers an errorthen a correction calculation on the data sent to system memory isperformed and the corrected data retransmitted. The method forcalculating the error can be done in hardware or software byconventional methods. The ECC is also able to calculate and locate thedefective cell causing the error. This may be used by the controller 31to update the defect map associated with the sector in which thedefective cell is detected. In this manner, hard errors are constantlyremoved from the Flash EEprom system.

FIG. 7 illustrates the write data path control in the preferredembodiment. The first portion of a write sequence is similar to a readsequence described previously. The microprocessor first loads theAddress pointers for the memory device 33 and the DMA as in the readsequence. It also loads the header desired into the address generator503 and the command queue into the command sequencer 511. The commandqueue is loaded with a read header command first. Thereafter, control ispassed over to the controller 31. The controller then gates the addressand command to the memory device 33, as in the read sequence. The memorydevice returns header data through controller's receiver 515. Thecontroller compares the received header data to the expected value(stored in the holding register file 509). If the compare is correct,the proper location is verified and the sequence continues. Then thecontroller loads the defective address pointers from the memory device33 into the holding register file 509 and the alternative data into thealternative defects data file 517.

Next, the controller begins to fetch the write data from system memory(not shown). It does this by getting access to the system bus, outputsthe memory or bus address and does the read cycle. It pulls the datainto a FIFO 601 through an input interface 603. The controller thenshifts the starting sector address (lowest byte address) from theaddress generator 503 to the selected memory device 33. This is followedby data from the FIFO 601. These data are rotted through multiplexers605 and 513 and converted to serial format before being sent to thememory device 33. This sequence continues until all bytes for a writecycle have been loaded into the selected memory.

A pipeline architecture is employed to provide efficient throughput asthe data is gated from the FIFO 601 to the selected memory 33. The datagated out of the FIFO 601 is sent to the ECC hardware 527 where aremainder value will be calculated within the ECC. In the next stage, asthe data is being sent to the memory device through multiplexers 605 and513, the comparator 521 is comparing its address from the addressgenerator 503 to the defect pointer address values in the holdingregister file 509. When a match occurs, indicating that a defectivelocation is about to be written, the controller saves this bit into thealternative defect data file 517. At the same time, all bad bits sent tomemory will be sent as zeroes.

After the bytes for a write cycle have been loaded into the selectedmemory device, the controller issues a program command to the memorydevice and initiate a write cycle. Optimized implementations of writeoperation for Flash EEprom device have been disclosed in two previouslycited co-pending U.S. patent applications, Ser. No. 204,175, now U.S.Pat. No. 5,095,344, and one entitled "Multi-State EEprom Read and WriteCircuits and Techniques, Ser. No. 07/337,579, filed Apr. 13, 1989, nowabandoned. Relevant portions of the disclosures are hereby incorporatedby reference. Briefly, during the write cycle, the controller applies apulse of programming (or writing) voltages. This is followed by a verifyread to determine if all the bits have been programmed properly. If thebits did not verify, the controller repeats the program/verify cycleuntil all bits are correctly programmed.

If a bit fails to verify after prolonged program/verify cycling, thecontroller will designate that bit as defective and update the defectmap accordingly. The updating is done dynamically, as soon as thedefective cell is detected. Similar actions are taken in the case offailure in erase verify.

After all the bits have been programmed and verified, the controllerloads the next data bits from the FIFO 601 and addresses the nextlocation in the addressed sector. It then performs anotherprogram/verify sequence on the next set of bytes. The sequence continuesuntil the end of the data for that sector. Once this has occurred, thecontroller addresses the shadow memory (header area) associated with thesector (see FIG. 5) and writes the contents of the ECC registers intothis area.

In addition, the collection of bits that was flagged as defective andwere saved in the alternative defects data file 516 is then written inmemory at the alternative defects data locations (see FIG. 5), therebysaving the good bit values to be used on a subsequent read. Once thesedata groups are written and verified, the sector write is consideredcompleted.

The present invention also has provision for defect mapping of the wholesector, but only after the number of defective cells in the sector hasexceeded the cell defect mapping's capacity for that specific sector. Acount is kept of the number of defective cells in each sector. When thenumber in a sector exceeds a predetermined value, the controller marksthat sector as defective and maps it to another sector. The defectpointer for the linked sectors may be stored in a sector defect map. Thesector defect map may be located in the orginal defective sector if itsspare area is sufficiently defect-free. However, when the data area ofthe sector has accumulated a large number of defects, it is quite likelythat the spare area will also be full of defects.

Thus, it is preferable in another embodiment to locate the sector map inanother memory maintained by the controller. The memory may be locatedin the controller hardware or be part of the Flash EEprom memory. Whenthe controller is given an address to access data, the controllercompares this address against the sector defect map. If a match occursthen access to the defective sector is denied and the substitute addresspresent in the defect map is entered, and the corresponding substitutesector is accessed instead.

In yet another embodiment, the sector remapping is performed by themicroprocessor. The microprocessor looks at the incoming address andcompares it against the sector defect map. If a match occurs, it doesnot issue the command to the controller but instead substitute thealternative location as the new command.

Apart from the much higher speed of the solid-state disk, anotheradvantage is the lack of mechanical parts. The long seek times,rotational latency inherent in disk drives are not present. In addition,the long synchronization times, sync mark detects and write gaps are notrequired. Thus the overhead needed for accessing the location where datais to be read or written is much less. All of these simplifications andlack of constraints result in a much faster system with much reducedoverheads. In addition, the files can be arranged in memory in anyaddress order desired, only requiring the controller to know how to getat the data as needed.

Another feature of the invention is that defect mapping is implementedwithout the need to interrupt the data stream transferred to or from thesector. The data in a block which may contain errors are transferredregardless, and is corrected afterwards. Preserving the sequentialaddressing will result in higher speed by itself. Further, it allows theimplementation of an efficient pipeline architecture in the read andwrite data paths.

Write Cache System

Cache memory is generally used to speed up the performance of systemshaving slower access devices For example in a computer system, access ofdata from disk storage is slow and the speed would be greatly improvedif the data could be obtained from the much faster RAM. Typically a partof system RAM is used as a cache for temporarily holding the mostrecently accessed data from disk. The next time the data is needed, itmay be obtained from the fast cache instead of the slow disk. The schemeworks well in situations where the same data is repeatedly operated on.This is the case in most structures and programs since the computertends to work within a small area of memory at a time in running aprogram. Another example of caching is the using of faster SRAM cache tospeed up access of data normally stored in cheaper but slower DRAM.

Most of the conventional cache designs are read caches for speeding upreads from memory. In some cases, write caches are used for speeding upwrites to memory. However in the case of writes to system memory (e.g.disks), data is still being written to system memory directly every timethey occur, while being written into cache at the same time. This isdone because of concern for loss of updated data files in case of powerloss. If the write data is only stored in the cache memory (volatile) aloss of power will result in the new updated files being lost from cachebefore having the old data updated in system memory (non-volatile). Thesystem will then be operating on the old data when these files are usedin further processing. The need to write to main memory every timedefeats the caching mechanism for writes. Read caching does not havethis concern since the data that could be lost from cache has a backupon disk.

In the present invention, a system of Flash EEprom is used to providenon-volatile memory in place of traditional system memories such as diskstorage. However, Flash EEprom memory is subject to wearing out byexcessive program/erase cycles. Even with the improved Flash EEprommemory device as disclosed in copending U.S. patent applications, Ser.No. 204,175 now U.S. Pat. No. 5,095,344, and Harari, Ser. No.07/337,579, filed Apr. 13, 1989, now abandoned, and Techniques," bySanjay Mehrotra and Dr. Eliyahou Harari filed on the same day as thepresent application, the endurance limit is approximately 10⁶program/erase cycles. In a ten-year projected life time of the device,this translates to a limit of one program/erase cycle per 5 minutes.This may be marginal in normal computer usage.

To overcome this problem, a cache memory is used in a novel way toinsulate the Flash EEprom memory device from enduring too manyprogram/erase cycles. The primary function of the cache is to act onwrites to the Flash EEprom memory and not on reads of the Flash EEprommemory, unlike the case with traditional caches. Instead of writing tothe Flash EEprom memory every time the data is updated, the data may beoperated on several times in the cache before- being committed to theFlash EEprom memory. This reduces the number of writes to the FlashEEprom memory. Also, by writing mostly into the faster cache memory andreducing the number of writes to the slower Flash EEprom, an additionalbenefit is the increase in system write throughput.

A relatively small size cache memory is quite effective to implement thepresent invention. This helps to overcome the problem of data loss inthe volatile cache memory during a power loss. In that event, it isrelatively easy to have sufficient power reserve to maintain the cachememory long enough and have the data dumped into a non-volatile memorysuch as a specially reserved space in the Flash EEprom memory. In theevent of a power down or and power loss to the system, the write cachesystem may be isolated from the system and a dedicated rechargeablepower supply may be switch in only to power the cache system and thereserved space in the Flash EEprom memory.

FIG. 8 illustrates schematically a cache system 701 as part of thecontroller, according to the present invention. On one hand the cachesystem 701 is connected to the Flash EEprom memory array 33. On theother hand it is connected to the microprocessor system (not shown)through a host interface 703. The cache system 701 has two memories. Oneis a cache memory 705 for temporarily holding write data files. Theother is a tag memory 709 for storing relevant information about thedata files held in the cache memory 705. A memory timing/control circuit713 controls the writing of data files from the cache memory 705 to theFlash EEprom memory 33. The memory control circuit 713 is responsive tothe information stored in the tag memory as well as a power sensinginput 715 with is connected through the host interface 703 via a line717 to the power supply of the microprocessor system. A power loss inthe microprocessor system will be sensed by the memory control circuit713 which will then down load all the data files in the volatile cachememory 705 to the non-volatile Flash EEprom memory 33.

In the present invention, the Flash EEprom memory array 33 is organizedinto sectors (typically 512 byte size) such that all memory cells withineach sector are erasable together. Thus each sector may be considered tostore a data file and a write operation on the memory array acts on oneor more such files.

During read of a new sector in the Flash EEprom memory 33, the data fileis read out and sent directly to the host through the controller. Thisfile is not used to fill the cache memory 705 as is done in thetraditional cache systems.

After the host system has processed the data within a file and wishes towrite it back to the Flash EEprom memory 33, it accesses the cachesystem 701 with a write cycle request. The controller then interceptsthis request and acts on the cycle.

In one embodiment of the invention, the data file is written to thecache memory 705. At the same time, two other pieces of informationabout the data file are written to a tag memory 709. The first is a filepointer which identifies the file present in the cache memory 705. Thesecond is a time stamp that tells what time the file was last writteninto the cache memory. In this way, each time the host wishes to writeto the Flash EEprom memory 33, the data file is actually first stored inthe cache memory 705 along with pointers and time stamps in the tagmemory 709.

In another embodiment of the invention, when a write from the hostoccurs, the controller first checks to see if that file already existedin the cache memory 705 or has been tagged in the tag memory 709. If ithas not been tagged, the file is written to the Flash memory 33, whileits identifier and time stamp are written to the tag memory 709. If thefile already is present in the cache memory or has been tagged, it isupdated in the cache memory and not written to the Flash memory. In thisway only infrequently used data files are written into the Flash memorywhile frequently used data files are trapped in the cache memory.

In yet another embodiment of the invention, when a write from the hostoccurs, the controller first checks to see if that data file has beenlast written anywhere within a predetermined period of time (forexample, 5 minutes). If it has not, the data file is written to theFlash memory 33, while its identifier and time stamp are written to thetag memory 709. If the data file has been last written within thepredetermined period of time, it is written into the cache memory 705and not written to the Flash memory. At the same time, its identifierand time stamp are written to the tag memory 709 as in the otherembodiments. In this way also, only infrequently used data files arewritten into the Flash memory while frequently used data files aretrapped in the cache memory.

In all embodiments, over time the cache memory 705 will start to fillup. When the controller has detected that some predetermined state offullness has been reached, it begins to archive preferentially somefiles over others in the cache memory 705 by writing them to the Flashmemory 33.

In either embodiments, over time the cache memory 705 will start to fillup. When the controller has detected that some predetermined state offullness has been reached, it begins to archive preferentially somefiles over others in the cache memory 705 by writing them to the Flashmemory 33. The file identifier tag bits for these files are then reset,indicating that these files may be written over. This makes room for newdata files entering the cache memory.

The controller is responsible for first moving the least active filesback into the Flash memory 33 to make room for new active files. To keeptrack of each file's activity level, the time stamp for each file isincremented by the controller at every time step unless reset by a newactivity of the file. The timing is provided by timers 711. At everytime step (count), the controller systematically accesses each data filein the cache memory and reads the last time stamp written for this datafile. The controller then increments the time stamp by another time step(i.e. increments the count by one).

Two things can happen to a file's time stamp, depending on the activityof the file. One possibility is for the time stamp to be reset in theevent of a new activity occurring. The other possibility is that no newactivity occurs for the file and the time stamp continues to incrementuntil the file is removed from the cache. In practice a maximum limitmay be reached if the time stamp is allowed to increase indefinitely.For example, the system may allow the time stamp to increment to amaximum period of inactivity of 5 minutes. Thus, when a data file iswritten in the cache memory, the time stamp for the file is set at itsinitial value. Then the time stamp will start to age, incrementing atevery time step unless reset to its initial value again by another writeupdate. After say, 5 minutes of inactivity, the time stamp hasincremented to a maximum terminal count.

In one embodiment of keeping count, a bit can be shifted one place in ashift register each time a count increment for a file occurs. If thefile is updated (a new activity has occurred) the bit's location will bereset to the initial location of the shift register. On the other hand,if the file remains inactive the bit will eventually be shifted to theterminal shift position. In another embodiment, a count value for eachfile is stored and incremented at each time step. After each increment,the count value is compared to a master counter, the difference beingthe time delay in question.

Thus, if a file is active its incremented time stamp is reset back tothe initial value each time the data file is rewritten. In this manner,files that are constantly updated will have low time stamp identifiersand will be kept in cache until their activity decreases. After a periodof inactivity has expired, they acquire the maximum time stampidentifiers. The inactive files are eventually archived to the Flashmemory freeing space in the cache memory for new, more active filesspace is also freed up in the tag memory when these inactive files aremoved to the Flash memory.

At any time -when room must be made available for new data files cominginto the cache memory, the controller removes some of the older filesand archives them to the Flash memory 33. Scheduling is done by a memorytiming/control circuit 713 in the controller. The decision to archivethe file is based on several criteria. The controller looks at thefrequency of writes occurring in the system and looks at how full thecache is. If there is still room in the cache, no archiving need to bedone. If more room is needed, the files with the earliest time stampsare first removed and archived to the Flash memory.

Although the invention has been described with implementation inhardware in the controller, it is to be understood that otherimplementations are possible. For example, the cache system may belocated elsewhere in the system, or be implemented by software using theexisting microprocessor system. Such variations are within the scope ofprotection for the present invention.

The Profile of how often data is written back to the Flash memory isdetermined by several factors It depends on the size of the cache memoryand the frequency of writes occurring in the system. With a small cachememory system, only the highest frequency files will be cached. Lessfrequently accessed files will also be cached with increasing cachememory size. In the present invention, a relatively cheap and smallamount of cache memory, preferably about 1 Mbyte, may be used to goodadvantage. By not constantly writing the most active files (the top 5%),the write frequency of the Flash EEprom may be reduced from the usualone every millisecond to one every 5 minutes. In this way the wear-outtime for the memory can be extended almost indefinitely. Thisimprovement is also accompanied by increased system performance duringwrite.

Incorporating time tag into the write cache concept has the advantagethat the size of the write cache buffer memory can be relatively small,since it is used only to store frequently written data files, with allother files written directly into the Flash EEprom memory. A secondadvantage is that the management of moving data files in and out of thewrite cache buffer can be automated since it does not require advancedknowledge of which data files are to be called next.

The various aspects of the present invention that have been describedco-operate in a system of Flash EEprom memory array to make the FlashEEprom memory a viable alternative to conventional non-volatile massstorage devices.

While the embodiments of the various aspects of the present inventionthat have been described are the preferred implementation, those skilledin the art will understand that variations thereof may also be possible.Therefore, the invention is entitled to protection within the full scopeof the appended claims.

We claim:
 1. A memory card connectable to a computer system, comprising:an array of Electrically Erasable and Programmable Read Only Memory ("EEPROM") cells partitioned into a plurality of flash sectors, the cells of the array being individually programmable into more than two states in order to store more than one bit of data per cell; each flash sector being a group of cells that are erasable together as a unit, and having a portion thereof reserved as redundant cells; and a memory controller for controlling operations of the EEPROM cells; error detection means within said memory controller for detecting any defective cells within the array; defect pointers, each generated by said memory controller for linking a detected defective cell's address to that of a corresponding redundant cell substituting for the defective cell, said defect pointers being stored within the array; and defective cell substituting means within said memory controller and responsive to said defect pointers for substituting said detected defective cell with said corresponding redundant cells.
 2. The memory card as in claim 1, wherein said plurality of sectors have a portion thereof reserved as redundant sectors, and said EEPROM controller, upon detecting more than a predetermined number of defective cells in a sector, substitutes said sector with one of said redundant sectors.
 3. The memory card as in claim 2, wherein said EEPROM controller including a circuit for implementing error correction codes for detecting and correcting errors in the operations of the EEPROM cells.
 4. The memory card as in claim 1, wherein said memory card is compatible with a magnetic disk drive storage system and capable of substituting therefor in said computer system.
 5. A memory card connectable to a computer system, said memory card comprising:an array of non-volatile floating gate memory cells partitioned into a plurality of sectors that individually include a distinct group of said array of memory cells that are erasable together as a unit, the individual sectors including a user data portion and a spare portion of the group of memory cells, the cells of the array being individually programmable into more than two states in order to store more than one bit of data per cell, a memory controller for controlling operation of the memory cell array and interfacing the memory cell array with the computer system, means within said memory controller for identifying defective cells within the user data portion of individual ones of said plurality of sectors, and means including said memory controller and responsive to detection of a defective cell within the user data portion of one of said plurality of sectors for substituting therefore a corresponding redundant cell within the spare portion of said one of said plurality of sectors.
 6. The memory card of claim 5, which additionally comprises means within said memory controller for, upon detecting a defective sector having more than a predetermined number of defective cells therein, substituting another of said plurality of sectors for the defective sector.
 7. The memory card of claim 5, which additionally comprises means within said memory controller for storing and accessing error correction codes in the spare portions of the sectors which are related to data stored in the user data portions of the same sectors.
 8. The memory card of claim 5, wherein said memory card is compatible with a magnetic disk drive storage system and capable of being substituted therefor in said computer system.
 9. A method of operating a computer system including a processor and a memory system, wherein the memory system includes an array of non-volatile floating gate memory cells partitioned into a plurality of sectors that individually include a distinct group of said array of memory cells that are erasable together as a unit, comprising:providing said memory array and a memory controller within a card that is removably connectable to the computer system, said controller being connectable to said processor for controlling operation of the array when the card is connected to the computer system, programming the individual cells of the array into one of more than two programmable states in order to store more than one bit of data per cell, reserving a portion of the memory cells within the individual sectors as spare cells, remaining cells of the individual sectors being designated for storing data, enabling the controller to detect when a cell within the data portion of a sector becomes defective, causing the controller to store an address of such a detected defective cell, and thereafter causing the controller to substitute for the defective cell a redundant cell from the spare cells of the sector in which the defective cell is detected.
 10. The method according to claim 9, wherein the storage of an address of a detected defective cell includes storing the address of the detected defective cell within the spare cells of the sector in which the defective cell exists.
 11. The method according to claim 10, wherein detecting the address of a defective cell includes maintaining a defect map which links addresses of defective cells to substitute redundant cells.
 12. The method according to claim 11, wherein detecting the address of a defective cell includes storing the defect map in the memory array.
 13. The method according to claim 9, additionally comprising:reserving a number of the sectors as redundant sectors, in response to a number of occurrences of a defective cell being detected within a single sector exceeding a predetermined number, marking such a single sector as a defective sector, and thereafter remapping the defective sector into one of the redundant sectors as a substitute for the defective sector.
 14. The method according to claim 13, wherein the marking of a sector as the defective sector includes placing an address of the defective sector into a defect map that includes an address of the substitute redundant sector, thereby causing the redundant sector to be accessed in response to a request to access the defective sector.
 15. The method according to claim 13, wherein a defect map is stored in the memory cell array.
 16. The method according to claim 13, wherein the marking and remapping operations are under the control of said memory controller.
 17. The method according to claim 9, additionally comprising storing addresses of the sectors in the spare cells of the sectors to which the address pertains.
 18. The method according to claim 9, additionally comprising storing in the spare cells of the individual sectors an error correction code for data stored in corresponding ones of the sectors. 